package openfidias.maker.model

import openfidias.maker.format.Formatter as f
/**
 *
 * @author atila
 */
class Attribute implements Serializable {
	String type, name

   String definition() {
      "${f.tab}private ${type} ${name};${f.ret}"
   }

   def getCall() {
      "get${name.capitalize()}()"
   }

   def getter() {
      /*"""
      public ${type} get${name.capitalize()} () {
         return this.${name};
      }
      """*/
      "${f.rt}public ${type} get${name.capitalize()} () {"
      .plus("${f.rt2}")
      .plus("return this.${name};")
      .plus("${f.rt}}${f.ret}")
   }

   def setter() {
      /*"""
      public void set${name.capitalize()} (${type} ${name}) {
         this.${name} = ${name};
      }
      """*/
      "${f.rt}public void set${name.capitalize()} (${type} ${name}) {"
      .plus("${f.rt2}")
      .plus("this.${name} = ${name};")
      .plus("${f.rt}}${f.ret}")
   }
}

